home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
BUSINESS
/
SALE24.ARJ
/
PDIAL.PRG
< prev
next >
Wrap
Text File
|
1992-06-01
|
770b
|
41 lines
Listing 1
P_DIAL Telephone Dialing Function
FUNCTION p_dial
PARAMETERS tel_no
*** Telephone number must character data!
*** note: com port should be initialized before
*** going into application that uses function.
f_handle = 0
ON ERROR DO ph_errr
f_handle = fopen('COM1','w') && open-write only
ON ERROR
IF f_handle = -1 && not a valid com port
?? chr(7)
ELSE && dial it!
junk = fputs(f_handle,'ATDT' + tel_no + ';')
junk = inkey(7) && pause for pick-up
junk = fputs(f_handle,'ATZ') && reset modem
junk = fclose(f_handle) && close port
ENDIF
RETURN(.t.)
********
PROCEDURE ph_errr
*** Error routine for bad com port.
f_handle = -1
RETURN
*******